<?php include dirname(__FILE__).'/common/header.php'; ?>

<?php include dirname(__FILE__).'/common/menu.php'; ?>

var attr = {};
attr.config_list = <?php echo $attr['config_list']?>;
attr.ctrlName = '<?php echo $ctrlName ?>';

/*
| -------------------------------------------------------------------
|  List Grid
| -------------------------------------------------------------------
*/
list.grid = new ZM.FormPanel({
    url : list.baseUrl + attr.ctrlName+'/saveConfig',
    keySubmit:false,
    region:'center',
    buttonAlign:'left',
    buttons:null,
    labelWidth:150,
    defaults:{xtype:'textfield',width:400},
    submitForm:function(){
        ZM.submitForm(list.grid);
    },
    success:function(res) {
        ZM.bo.msg('成功!',res.detail);
        location.reload();
    },
    failure:function(res) {
        location.reload();
    },
    items:[{
        xtype:'datetimefield',
        fieldLabel:'预热篇开始时间',
        name:'hd_invitation_type_1_start',
        value:ZM.id2name('hd_invitation_type_1_start',attr.config_list),
        allowBlank:false
    },{
        xtype:'datetimefield',
        fieldLabel:'预热篇结束时间',
        name:'hd_invitation_type_1_end',
        value:ZM.id2name('hd_invitation_type_1_end',attr.config_list),
        allowBlank:false
    },{
        xtype:'datetimefield',
        fieldLabel:'双12篇开始时间',
        name:'hd_invitation_type_2_start',
        value:ZM.id2name('hd_invitation_type_2_start',attr.config_list),
        allowBlank:false
    },{
        xtype:'datetimefield',
        fieldLabel:'双12篇结束时间',
        name:'hd_invitation_type_2_end',
        value:ZM.id2name('hd_invitation_type_2_end',attr.config_list),
        allowBlank:false
    },{
        xtype:'datetimefield',
        fieldLabel:'圣诞篇开始时间',
        name:'hd_invitation_type_3_start',
        value:ZM.id2name('hd_invitation_type_3_start',attr.config_list),
        allowBlank:false
    },{
        xtype:'datetimefield',
        fieldLabel:'圣诞篇结束时间',
        name:'hd_invitation_type_3_end',
        value:ZM.id2name('hd_invitation_type_3_end',attr.config_list),
        allowBlank:false
    },{
        xtype:'button',
        text:'提交',
        hidden:!Ext.permission[attr.ctrlName+'/saveConfig'.toLowerCase()],
        style:'margin:20px 0 0 155px;',
        width:70,
        handler:function() {list.grid.submitForm();}
    }]
});

<?php include dirname(__FILE__).'/common/layout.php'; ?>
<?php include dirname(__FILE__).'/common/footer.php'; ?>
